package com.lz;


import com.lz.service.config.TraceIdResponseAdvice;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.Map;
import java.util.Set;


@SpringBootApplication
@MapperScan("com.lz.**.mapper")
@EnableScheduling//支持定时任务handlerMappings
public class Application {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
        Map<String, Object> beansOfType = run.getBeansOfType(Object.class);
        Set<String> strings = beansOfType.keySet();
        for (String string : strings) {
            Object o = beansOfType.get(string);
            if (o instanceof TraceIdResponseAdvice) {
                System.out.println(string);
            }
        }
        TraceIdResponseAdvice bean = run.getBean(TraceIdResponseAdvice.class);
        System.out.println(bean);
        System.out.println(run);
    }

}